#include "Queue.h"
#include <assert.h>

Queue::Queue()
{
	queueItems = new LinkedList();
	queueItems->InitList();
}

Queue::~Queue()
{
	queueItems->ClearList();
	delete queueItems;
}

void Queue::EnQueue(int data)
{
	queueItems->InsertListLast(new LinkedListNode(data));	
}

int Queue::DeQueue()
{
	assert(!IsEmpty());
	int data = queueItems->GetData(1);
	queueItems->DeleteListFirst();
	return data;
}

int Queue::FrontQueue()
{
	assert(!IsEmpty());
	return queueItems->GetData(1);
}

bool Queue::IsEmpty()
{
	return queueItems->IsListEmpty();
}


